<?php $this->headScript()->appendFile('js/admin/listing_filters.js'); ?>
        <div class="fix_20"></div>
        <form method="post" id="admin_listing_filter">
            <input type="hidden" name="do_filter" value="1">
            <input type="hidden" id="reset_filter" name="reset_filter" value="0">
            <table width="100%" border="0" class="shadow">
                <tr>
                    <td width="49%" valign="top">
                        <strong><a href="#" id="filter_btn" class="filtre_icon filtre_icon_select">Filtre</a></strong>
                        <div class="fix_5"></div>
                        <div id="filter_block" style="display: none;">
                            <img src="media/images/admin/sep.gif"  alt="" />
                            <div class="fix_10"></div>

                            <?php foreach($this->grid->getFilters() as $filter) { ?>
                                <table class="ul_def_li" width="100%">
                                    <tr>
                                        <td width="34%">
                                            <input type="checkbox" value="<?php echo $filter->getField(); ?>" onclick="toggleFilter('<?php echo $filter->getField(); ?>');" name="filter[fields][]" id="cb_<?php echo $filter->getField(); ?>"<?php if ($filter->isSelected()) echo ' checked="true"'; ?>>
                                            <label for="cb_<?php echo $filter->getField(); ?>"><?php echo $filter->getLabel(); ?></label>
                                        </td>
                                        <td width="33%">
                                            <select onchange="toggleOperator('<?php echo $filter->getField(); ?>');" name="filter[operators][<?php echo $filter->getField(); ?>]" id="operators_<?php echo $filter->getField(); ?>" class="select-small ob_<?php echo $filter->getField(); ?>">
                                                <?php foreach($filter->getOperators() as $operator) { ?>
                                                    <option<?php if ($operator->isSelected()) echo ' selected="selected"'; ?> value="<?php echo $operator->getName(); ?>"><?php echo $operator->getLabel(); ?></option>
                                                <?php } ?>
                                            </select>
                                        </td>
                                        <td width="33%">
                                            <?php
                                                $filterType = get_class($filter);
                                                $filterType = explode('\\', $filterType);
                                                $filterType = array_pop($filterType);

                                                switch($filterType) {
                                                    case 'Text':
                                            ?>
                                            <div class="ob_<?php echo $filter->getField(); ?>" id="div_values_<?php echo $filter->getField(); ?>">
                                                <input type="text" size="30" name="filter[values][<?php echo $filter->getField(); ?>]" id="values_<?php echo $filter->getField(); ?>" class="select-small" value="<?php if ($filter->isSelected()) echo $filter->getOperator()->getValue(); ?>">
                                            </div>
                                            <?php
                                                    break;

                                                    case 'Entity':
                                            ?>
                                            <div class="ob_<?php echo $filter->getField(); ?>" id="div_values_<?php echo $filter->getField(); ?>">
                                                <select style="vertical-align: top;" class="select-small" id="values_<?php echo $filter->getField(); ?>" name="filter[values][<?php echo $filter->getField(); ?>][]">
                                            <?php
                                                foreach($filter->getData() as $data) {
                                                    $filter->getDataValue($data);
                                            ?>
                                                <option value="<?php echo $filter->getDataValue($data); ?>"><?php echo $filter->getDataLabel($data); ?></option>
                                            <?php
                                                }
                                            ?>
                                                </select>
                                    <a style="vertical-align: bottom; margin-top: -7px; padding-left: 10px;" onclick="toggleMultiSelect('<?php echo $filter->getField(); ?>'); return false;" href="javascript: void(0);"><img src="images/icons/add.png" alt="Bullet_toggle_plus"></a>
                                            </div>
                                            <?php
                                                    break;
                                                }
                                            ?>
                                        </td>
                                    </tr>
                                </table>
                            <?php } ?>
                        </div>
                    </td>
                    <td width="2%"> &nbsp; </td>
                    <td width="49%" valign="top">
                        <strong><a href="#" id="options_btn" class="filtre_icon filtre_icon_select">Optiuni</a></strong>
                        <div class="fix_5"></div>
                        <div id="options_block" style="display: none;">
                            <img src="media/images/admin/sep.gif"  alt="" />
                            <div class="fix_10"></div>

                            <select multiple="multiple" name="available_columns[]" id="available_columns" size="5" style="width: 190px; margin-right: 10px;" class="float_left">
                               <?php $columns = $this->grid->getInvisibleColumns(); ?>
                                <?php if (count($columns) > 0) { ?>
                                    <?php foreach ($columns as $column){ ?>
                                        <option value="<?php echo $column->getField() ?>"><?php echo $this->translate($column->getLabel()); ?></option>
                                    <?php } ?>
                                <?php } ?>
                            </select>
                            <div class="float_left">
                                <div class="fix_15"></div>
                                <a href="#" id="move_right"><img src="media/images/admin/icons/sel_1.gif" alt="" /></a>
                                <div class="fix_5"></div>
                                <a href="#" id="move_left"><img src="media/images/admin/icons/sel_2.gif" alt="" /></a>
                            </div>
                            <select multiple="multiple" name="options[selected_columns][]" id="selected_columns" size="5" style="width: 190px; margin-left: 10px;" class="float_left">
                                <?php $columns = $this->grid->getVisibleColumns(); ?>
                                <?php if (count($columns) > 0) { ?>
                                    <?php foreach ($columns as $column){ ?>
                                        <option value="<?php echo $column->getField() ?>"><?php echo $this->translate($column->getLabel()); ?></option>
                                    <?php } ?>
                                <?php } ?>
                            </select>
                            <div class="float_left" style="margin-left: 5px;">
                                <div class="fix_10"></div>
                                <a href="#" id="move_up"><img src="media/images/admin/icons/sel_up.gif" alt="" /></a>
                                <div class="fix_5"></div>
                                <a href="#" id="move_down"><img src="media/images/admin/icons/sel_down.gif" alt="" /></a>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
            <div class="fix_10"></div>
            <div class="back_gri">
                <div class="fix_10"></div>
                <a href="#" id="filter_cancel_btn" class="botton_red float_right" style="margin-left: 10px; margin-right: 10px;">Reset</a>
                <a href="#" id="filter_submit_btn" class="botton_green float_right">Salveaza</a>
                <div class="fix_10"></div>
            </div>
        </form>
        <div class="fix_10"></div>
        <div class="float_left">
            <div class="position_relative float_left" style="margin-right: 10px;">
                <select id="quick_actions" class="sparkbox-custom" name="quick_actions">
                    <option value=""><?php echo $this->translate('Alege ...'); ?></option>
                    <?php foreach ($this->grid->getQuickActions() as $quickAction) { ?>
                        <option value="<?php echo $quickAction ?>"><?php echo  ucfirst($quickAction) ?></option>
                    <?php } ?>
                </select>
            </div>
            <a href="#" id="quick_action_btn" class="botton float_left"><?php echo $this->translate('Opereaza'); ?></a>
        </div>
        <div class="float_right">
            <?php  echo $this->paginationControl($this->paginator,
                                    'Sliding',
                                    'admin/admin_pagination.phtml'); ?>
        </div>
        <div class="fix_10"></div>


        <form name="admin_listing" id="admin_listing_frm" method="post">
            <input type="hidden" name="do_action" value="1">
            <input type="hidden" name="do_sort_order" id="do_sort_order" value="0">
            <input type="hidden" name="str_sort_order" id="str_sort_order" value="">
            <input type="hidden" name="quick_action" id="quick_action" value="">
            <table border="0" class="tab_lista shadow" id="item_listing">
                <thead>
                    <tr class="nodrop nodrag">
                        <td class="headrt_tab" width="58"><strong><?php echo $this->translate('Editeaza'); ?></strong></td>
                        <td class="headrt_tab" width="12"><input type="checkbox" id="item_select" /></td>
                        <?php foreach($this->grid->getVisibleColumns() as $column) { ?>
                        <td class="headrt_tab">
                            <strong>
                            <a href="<?php echo $this->url(array('set' => 'order', 'field' => $column->getField())); ?>"<?php if ($this->grid->getOrderBy() == $column->getField()) { ?>
                                    class="<?php echo strtolower($this->grid->getOrderType()) == 'asc' ? 'sageata_sus' : 'sageata_jos'; ?>"<?php } ?>>
                                <?php echo $this->translate($column->getLabel()); ?>
                            </a>
                            </strong>
                        </td>
                        <?php } ?>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->paginator as $item) { ?>
                    <tr>
                        <td class="tab_alb" style="padding: 0px;">
                            <a href="<?php echo $this->url(array('action' => 'edit', 'id' => $item->getId())); ?>" class="editeaza_bott">&nbsp;</a>
                            <a href="<?php echo $this->url(array('action' => 'delete', 'id' => $item->getId())); ?>" class="sterge_bott">&nbsp;</a>
                        </td>
                        <td class="tab_alb"><input type="checkbox" name="action_item[]" class="action_item" value="<?php echo $item->getId(); ?>" /></td>
                        <?php foreach($this->grid->getVisibleColumns() as $column) { ?>
                            <?php echo $this->gridDisplayField($this->grid, $column, $item)?>
                        <?php } ?>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </form>